home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrscript / common files / qtvrutilities.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  4.7 KB  |  134 lines

  1. //////////
  2. //
  3. //    File:        QTVRUtilities.h
  4. //
  5. //    Contains:    Some utilities for working with QuickTime VR movies.
  6. //                All utilities start with the prefix "QTVRUtils_".
  7. //
  8. //    Written by:    Tim Monroe
  9. //
  10. //    Copyright:    © 1996-1997 by Apple Computer, Inc., all rights reserved.
  11. //
  12. //    Change History (most recent first):
  13. //
  14. //       <3>         02/03/99    rtm        moved non-QTVR-specific utilities to QTUtilities
  15. //       <2>         01/27/97    rtm        added some constants
  16. //       <1>         11/27/96    rtm        first file
  17. //       
  18. //////////
  19.  
  20. #pragma once
  21.  
  22.  
  23. //////////
  24. //
  25. // header files
  26. //
  27. //////////
  28.  
  29. #ifndef __QTVRUtilities__
  30. #define __QTVRUtilities__
  31.  
  32. #ifndef __MOVIES__
  33. #include <Movies.h>
  34. #endif
  35.  
  36. #ifndef __QUICKTIMEVR__
  37. #include <QuickTimeVR.h>
  38. #endif
  39.  
  40. #ifndef __QUICKTIMEVRFORMAT__
  41. #include <QuickTimeVRFormat.h>
  42. #endif
  43.  
  44. #ifndef __ENDIAN__
  45. #include <Endian.h>
  46. #endif
  47.  
  48. #ifndef __GESTALT__
  49. #include <Gestalt.h>
  50. #endif
  51.  
  52. #ifndef __Prefix_File__
  53. #include "MacPrefix.h"
  54. #endif
  55.  
  56. #ifndef __QD3D__
  57. #include "QD3D.h"
  58. #endif
  59.  
  60.  
  61. //////////
  62. //
  63. // constants
  64. //
  65. //////////
  66.  
  67. // values of π
  68. #define kVRPi                     ((float)3.1415926535898)
  69. #define kVR2Pi                     ((float)(2.0 * 3.1415926535898))
  70. #define kVRPiOver2                ((float)(3.1415926535898 / 2.0))
  71. #define kVR3PiOver2                ((float)(3.0 * 3.1415926535898 / 2.0))
  72.  
  73. // define a constant for an invalid hot spot ID;
  74. // hot spot IDs are just indices into an 8-bit palette, so valid IDs range from 0 to 255
  75. #define kQTVRUtils_InvalidHotSpotID                (UInt32)-1
  76.  
  77.  
  78. //////////
  79. //
  80. // angle conversion utilities
  81. //
  82. //////////
  83.  
  84. #define QTVRUtils_DegreesToRadians(x)            ((float)((x) * kVRPi / 180.0))
  85. #define QTVRUtils_RadiansToDegrees(x)            ((float)((x) * 180.0 / kVRPi))
  86.  
  87. // some other define'd symbols
  88. #define QTVRUtils_GetDistance(thePoint)            sqrt((thePoint.x*thePoint.x)+(thePoint.y*thePoint.y)+(thePoint.z*thePoint.z))
  89.  
  90.  
  91. //////////
  92. //
  93. // function prototypes
  94. //
  95. //////////
  96.  
  97. Boolean                        QTVRUtils_IsQTVRMgrInstalled (void);
  98. long                        QTVRUtils_GetQTVRVersion (void);
  99. Boolean                        QTVRUtils_IsQTVRMovie (Movie theMovie);
  100. Boolean                        QTVRUtils_Is20QTVRMovie (Movie theMovie);
  101. Boolean                        QTVRUtils_IsTranslateAvailable (QTVRInstance theInstance);
  102. Boolean                        QTVRUtils_IsZoomAvailable (QTVRInstance theInstance);
  103. Boolean                        QTVRUtils_IsPanoNode (QTVRInstance theInstance);
  104. Boolean                        QTVRUtils_IsObjectNode (QTVRInstance theInstance);
  105. Boolean                        QTVRUtils_IsHotSpotInNode (QTVRInstance theInstance);
  106. Boolean                        QTVRUtils_IsMultiNode (QTVRInstance theInstance);
  107. Boolean                        QTVRUtils_IsBackBufferHorizontal (QTVRInstance theInstance);
  108. void                        QTVRUtils_HideHotSpotNames (MovieController theMC);
  109. void                        QTVRUtils_ShowHotSpotNames (MovieController theMC);
  110. void                        QTVRUtils_ToggleHotSpotNames (MovieController theMC);
  111. OSErr                        QTVRUtils_GetVRWorldHeaderAtomData (QTVRInstance theInstance, QTVRWorldHeaderAtomPtr theVRWorldHdrAtomPtr);
  112. OSErr                        QTVRUtils_GetNodeHeaderAtomData (QTVRInstance theInstance, UInt32 theNodeID, QTVRNodeHeaderAtomPtr theNodeHdrPtr);
  113. OSErr                        QTVRUtils_GetHotSpotAtomData (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID, QTVRHotSpotInfoAtomPtr theHotSpotInfoPtr);
  114. char *                        QTVRUtils_GetStringFromAtom (QTAtomContainer theContainer, QTAtom theParent, QTAtomID theID);
  115. OSErr                        QTVRUtils_AddStr255ToAtomContainer (QTAtomContainer theContainer, QTAtom theParent, Str255 theString, QTAtomID *theID);
  116. UInt32                        QTVRUtils_GetDefaultNodeID (QTVRInstance theInstance);
  117. UInt32                        QTVRUtils_GetSceneFlags (QTVRInstance theInstance);
  118. char *                        QTVRUtils_GetSceneName (QTVRInstance theInstance);
  119. UInt32                        QTVRUtils_GetNodeCount (QTVRInstance theInstance);
  120. OSErr                        QTVRUtils_GetNodeType (QTVRInstance theInstance, UInt32 theNodeID, OSType *theNodeType);
  121. char *                        QTVRUtils_GetNodeName (QTVRInstance theInstance, UInt32 theNodeID);
  122. char *                        QTVRUtils_GetNodeComment (QTVRInstance theInstance, UInt32 theNodeID);
  123. UInt32                        QTVRUtils_GetHotSpotCount (QTVRInstance theInstance, UInt32 theNodeID, Handle theHotSpotIDs);
  124. UInt32                        QTVRUtils_GetHotSpotIDByIndex (QTVRInstance theInstance, Handle theHotSpotIDs, UInt32 theIndex);
  125. OSErr                        QTVRUtils_GetHotSpotType (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID, OSType *theHotSpotType);
  126. char *                        QTVRUtils_GetHotSpotName (QTVRInstance theInstance, UInt32 theNodeID, UInt32 theHotSpotID);
  127. float                        QTVRUtils_Point3DToPanAngle (float theX, float theY, float theZ);
  128. float                        QTVRUtils_Point3DToTiltAngle (float theX, float theY, float theZ);
  129. void                        QTVRUtils_PanAngleToPoint3D (float thePanAngle, float *theX, float *theZ);
  130. PASCAL_RTN OSErr            QTVRUtils_StandardEnteringNodeProc (QTVRInstance theInstance, long theNodeID, MovieController theMC);
  131. PASCAL_RTN OSErr            QTVRUtils_StandardLeavingNodeProc (QTVRInstance theInstance, long fromNodeID, long toNodeID, Boolean *theCancel, MovieController theMC);
  132.  
  133.  
  134. #endif    // ifndef __QTVRUtilities__